package com.github.fork.config;

import org.glassfish.jersey.servlet.ServletContainer;
import org.glassfish.jersey.servlet.ServletProperties;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Jerry Liu
 * @since 2017/3/22
 */
public class ApplicationConfig {

    public ServletRegistrationBean jersey() {
        ServletRegistrationBean registrationBean = new ServletRegistrationBean(new ServletContainer(), "/*");
        registrationBean.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, JerseyConfig.class.getName());
        return registrationBean;
    }
}
